package com.jdz.dao;

import com.jdz.pojo.User;
import org.apache.ibatis.annotations.Param;

import java.util.Date;
import java.util.List;

public interface UserMapper {
    int deleteByPrimaryKey(Integer stuno);

    int insert(User record);

    int insertSelective(User record);

    User selectByPrimaryKey(Integer stuno);

    int updateByPrimaryKeySelective(User user);

    int updateByPrimaryKey(User record);


    int checkEmail(String shuEmail);

    User checkStuId(String stuId);

    User checkStuNo(Integer stuno);

    int  checkStuIdCount(String stuId);
    //如果声明就是声明的，不声明就是属性名
    User selectLogin(@Param("stuId") String stuid, @Param("stuPassword") String md5Password);

    String selectQuestionByUsername(String stuId);

    int checkAnswer(@Param("stuId") String stuId, @Param("question") String question, @Param("answer") String answer);

    int updatePasswordByUsername(@Param("stuId") String stuId, @Param("passwordNew") String passwordNew);
    //(@Param("username")默认就是(@Param(value="username")
    int checkPassword(@Param("stuPassword") String password, @Param("stuNo") Integer stuNo);

    int checkEmailByUserId(@Param("stuEmail") String email, @Param("stuNo") Integer stuNo);

   // int addLock(@Param("stuNo") Integer shuNo, @Param("lock_times") String lock_times);

    List<User> selectListUser();

    List<User> selectListUserTimeSort();

    List<User> selectListUserTime(@Param("startTimeDate") Date startTimeDate, @Param("stopTimeDate") Date stopTimeDate);

    int selectListUserCount();

    List<User> selectSearchUser(String name);

    List<User> selectSearchUserTimeSort(String name);

    List<User> selectInstituteUser(@Param("stuInstitute") String stuInstitute, @Param("startTimeDate") Date startTimeDate, @Param("stopTimeDate") Date stopTimeDate);

    List<User> selectByIdUser(List<Integer> stuNolist);

    List<User> selectAllUser();

    List<Integer> selectInstitute(String stuInstitute);
}